﻿using Jhong.FunMVC;
using Jhong.FunMVC.Razor;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Owin
{
    public static class RazorMiddleware
    {
        public static FunMVCExtension UseRazor(this  FunMVCExtension extension)
        {
            extension.Option.GetViewResultInstance = RazorInstanceFactory.CreateRazorViewResultInstance;
            return extension;
        }

        public static FunMVCExtension UseRazor(this  FunMVCExtension extension, IList<string> customSearchPath)
        {
            foreach (var p in customSearchPath)
                View.SearchPath.Add(p);
            return extension.UseRazor();
        }
    }
}
